import request from '@/utils/request.js'


// const baseUrl = "http://172.20.10.2:9003"
const baseUrl = "http://localhost:9003"

export function getCourse(userId) {
    return request({
        url: baseUrl + '/chaoxing/courses/' + userId,
        method: 'get',
    })
}

export function getCoursex(userId) {
    return request({
        url: baseUrl + '/chaoxing/coursesx/' + userId,
        method: 'get',
    })
}

export function getData(userId) {
    return request({
        url: baseUrl + '/chaoxing/data/' + userId,
        method: 'get',
    })
}

export function putCourse(userId, data) {
    return request({
        url: baseUrl + '/chaoxing/put/' + userId,
        method: 'post',
        data: data
    })
}

export function openOrClose(userId, op) {
    return request({
        url: baseUrl + '/chaoxing/switch/' + userId + "/" + op,
        method: 'get'
    })
}

export function getOne(userId, data) {
    return request({
        url: baseUrl + '/chaoxing/get/course/' + userId,
        method: 'post',
        data
    })
}

export function login(userId, data) {
    return request({
        url: baseUrl + '/chaoxing/login/' + userId,
        method: 'post',
        data: data
    })
}



